﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace AssettDatabase
{
    public partial class Form_Add_Asset_Type : Form
    {
        public Form_Add_Asset_Type()
        {
            InitializeComponent();
        }

        
        private void button2_Click(object sender, EventArgs e)
        {
           
            
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                BLL.Asset_Type Asset_Type = new BLL.Asset_Type();
                if (!Asset_Type.Add(AAT_TB_Asset_Type_Name.Text))
                    MessageBox.Show("An error occurred during Add Asset insert");
                else
                    MessageBox.Show(AAT_TB_Asset_Type_Name.Text + " has been added to the Assett Database");
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void AAT_TB_Asset_Type_Name_TextChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
    }
}
